Changing lines like this: "extract( $dbw->tableNames( 'page', 'archive' ) );" to...
authorNick Jenkins <nickj@users.mediawiki.org>
Mon, 27 Nov 2006 08:36:57 +0000 (08:36 +0000)
committerNick Jenkins <nickj@users.mediawiki.org>
Mon, 27 Nov 2006 08:36:57 +0000 (08:36 +0000)
commita474761d9a03ccb7a7736c97b897268c7efe0e29
tree7c29e6cdd77c2344889f262609525f9aeea6c0b3
parentf9ca2e9672ddf41e5ec2ae5ba41347daa5db0a9f
Changing lines like this: "extract( $dbw->tableNames( 'page', 'archive' ) );" to be like this: "list ($page, $archive) = $dbw->tableNamesN( 'page', 'archive' );".

Three reasons for this:
1) It's better for analysis tools [which want explicit variable declaration]
2) It's easier for a human to read, as it's completely explicit where the variables came from [which is something you don't get with extract() ]
3) It makes it easier to find everywhere where a variable is used with search/grep [which you can't currently do with $tbl_page variables from things like: "extract($db->tableNames( 'page', 'revision'), EXTR_PREFIX_ALL, 'tbl');"].

Otherwise, from a functionality/efficiency perspective the two forms should be identical.

By doing this have been able run static analysis over the usages of these variables, thus eliminating 5 unneeded table names from calls, plus removing 3 unused calls entirely, and it just feels subjectively slightly nicer to me.
33 files changed:
includes/Block.php
includes/Database.php
includes/Image.php
includes/SiteStats.php
includes/Skin.php
includes/SkinTemplate.php
includes/SpecialBrokenRedirects.php
includes/SpecialContributions.php
includes/SpecialDeadendpages.php
includes/SpecialDoubleRedirects.php
includes/SpecialLonelypages.php
includes/SpecialMostcategories.php
includes/SpecialMostimages.php
includes/SpecialMostlinked.php
includes/SpecialMostlinkedcategories.php
includes/SpecialMostrevisions.php
includes/SpecialNewpages.php
includes/SpecialRecentchanges.php
includes/SpecialRecentchangeslinked.php
includes/SpecialStatistics.php
includes/SpecialUncategorizedimages.php
includes/SpecialUncategorizedpages.php
includes/SpecialUndelete.php
includes/SpecialUnusedcategories.php
includes/SpecialUnusedimages.php
includes/SpecialUnusedtemplates.php
includes/SpecialUnwatchedpages.php
includes/SpecialWantedcategories.php
includes/SpecialWatchlist.php
includes/SpecialWhatlinkshere.php
includes/UserMailer.php
includes/api/ApiQueryLogEvents.php
includes/api/ApiQueryUserContributions.php